import React, { Component } from 'react'
import './03_Button.css';
import gif from './loading.gif';
export default class Button extends Component {
  render() {
    //获取外部传入的数据
    console.log(this.props);
    let {children, type, disabled, loading, onClick} = this.props;
    return (
      <button onClick={onClick} className={type + ' ' + (disabled ? 'disabled' : '')}>
        {loading && <img width='12' src={gif} alt="" /> }
        {children}
      </button>
    )
  }
}
